import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import path from 'path';

export default defineConfig({
  plugins: [vue()],
  build: {
    lib: {
      entry: path.resolve(__dirname, 'src/index.ts'),
      name: 'scp-bpmn',
      fileName: (format) => `scp-bpmn.${format}.js`
    },
    rollupOptions: {
      external: ['vue', 'element-plus', '@element-plus/icons-vue', 'bpmn-js', 'inherits'],
      output: {
        globals: {
          vue: 'Vue',
          'element-plus': 'ElementPlus',
          '@element-plus/icons-vue': 'ElementPlusIconsVue',
          'bpmn-js': 'BpmnJS',
          'inherits': 'inherits'
        }
      }
    }
  }
});